# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultScoreSource do
  @moduledoc """
  A scorecard result may have multiple sets of scores from varying sources, one of which becomes the "main" answer above. A ScoreSource represents each individual set of scores.

  ## Attributes

  *   `normalizedScore` (*type:* `float()`, *default:* `nil`) - The normalized score, which is the score divided by the potential score.
  *   `potentialScore` (*type:* `float()`, *default:* `nil`) - The maximum potential overall score of the scorecard. Any questions answered using `na_value` are excluded from this calculation.
  *   `qaTagResults` (*type:* `list(GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultQaTagResult.t)`, *default:* `nil`) - Collection of tags and their scores.
  *   `score` (*type:* `float()`, *default:* `nil`) - The overall numerical score of the result.
  *   `sourceType` (*type:* `String.t`, *default:* `nil`) - What created the score.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :normalizedScore => float() | nil,
          :potentialScore => float() | nil,
          :qaTagResults =>
            list(
              GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultQaTagResult.t()
            )
            | nil,
          :score => float() | nil,
          :sourceType => String.t() | nil
        }

  field(:normalizedScore)
  field(:potentialScore)

  field(:qaTagResults,
    as:
      GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultQaTagResult,
    type: :list
  )

  field(:score)
  field(:sourceType)
end

defimpl Poison.Decoder,
  for:
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultScoreSource do
  def decode(value, options) do
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultScoreSource.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for:
    GoogleApi.ContactCenterInsights.V1.Model.GoogleCloudContactcenterinsightsV1QaScorecardResultScoreSource do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
